]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
workspacesView: Consider workspaces-only-on-primary when panning
authorFlorian Müllner <fmuellner@gnome.org>
Fri, 24 Jun 2016 16:19:40 +0000 (18:19 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Mon, 27 Jun 2016 14:31:00 +0000 (16:31 +0200)
It is odd to switch workspaces on the primary monitor when panning on
a monitor without workspaces, so reject the gesture on non-primary
monitors when workspaces-only-on-primary is disabled.

https://bugzilla.gnome.org/show_bug.cgi?id=766883

js/ui/workspacesView.js

index f8217cffd7805df898361ec7f119c23c29c5c673..2eacb5f2ded2a3f1ab553377aab87b7cb7c1a902 100644 (file)
@@ -437,6 +437,12 @@ const WorkspacesDisplay = new Lang.Class({
         let panAction = new Clutter.PanAction({ threshold_trigger_edge: Clutter.GestureTriggerEdge.AFTER });
         panAction.connect('pan', Lang.bind(this, this._onPan));
         panAction.connect('gesture-begin', Lang.bind(this, function() {
+            if (this._workspacesOnlyOnPrimary) {
+                let event = Clutter.get_current_event();
+                if (this._getMonitorIndexForEvent(event) != this._primaryIndex)
+                    return false;
+            }
+
             for (let i = 0; i < this._workspacesViews.length; i++)
                 this._workspacesViews[i].startSwipeScroll();
             return true;